#include "BitShifter.h"

#include<stdio.h>

int main()
{
	unsigned char bit = 0x00;
	unsigned char value = 0x01;
	BitShifter shifter = BitShifter(ShiftRight);
	shifter.set(value);
	for(int i = 7; i >= 0; i--)
		printf("%d", shifter[i]);
	printf("\n");
	//now do the shifting test.
	for(int i = 0; i < 8; i++)
		printf("%d", shifter.shiftOut());
	printf("\nnext test\n");
	unsigned char a[8]={1,1,0,0,1,1,0,0};
	for(int i = 0; i < 8; i++)
		shifter.shiftIn(a[i]);
	for(int i = 0; i < 8; i++)
		printf("%d", a[i]);
	printf("\n");
	for(int i = 7; i >= 0; i--)
		printf("%d", shifter[i]);
	printf("\nFinished\n");

	shifter = BitShifter(ShiftLeft);
	shifter.set(value);
	for(int i = 7; i >= 0; i--)
		printf("%d", shifter[i]);
	printf("\n");
	//now do the shifting test.
	for(int i = 0; i < 8; i++)
		printf("%d", shifter.shiftOut());
	printf("\nnext test\n");
	//unsigned char a[8]={1,1,0,0,1,1,0,0};
	for(int i = 0; i < 8; i++)
		shifter.shiftIn(a[i]);
	for(int i = 0; i < 8; i++)
		printf("%d", a[i]);
	printf("\n");
	for(int i = 7; i >= 0; i--)
		printf("%d", shifter[i]);
	printf("\nFinished\n");
	
}
